package com.t4.courseware.pojo.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

@Getter
public enum Gender {
    DEFAULT(0, "保密"),
    MALE(1, "男"),
    FEMALE(2, "女");

    @EnumValue // 标记存储到数据库的值
    private final Integer code;
    @JsonValue // 标记json返回的值

    private final String sex;

    Gender(Integer code, String sex){
        this.code = code;
        this.sex = sex;
    }
}
